package cn.zebra.dev.admin.module.admin.entity;

import cn.zebra.dev.base.module.admin.entity.BaseAdmin;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;

import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.Collection;

/**
 * 后台用户
 *
 * @author runnable
 * @date 2019-09-07 16:00:10
 */
@TableName("admin")
@Getter
@Setter
public class AdminEntity implements Serializable, BaseAdmin {
    private static final long serialVersionUID = 1L;

    @TableId(type = IdType.AUTO)
    private Long id;

    @ApiModelProperty("0系统后台用户")
    private Integer adminType;

    @ApiModelProperty("后台用户账号")
    private String account;

    @ApiModelProperty("后台用户名")
    private String adminName;

    @ApiModelProperty(value = "盐", hidden = true)
    private String salt;

    @ApiModelProperty(value = "密码", hidden = true)
    private String password;

    @ApiModelProperty("最后登录ip")
    private String lastLoginIp;

    @ApiModelProperty("最后登录时间")
    private Long lastLoginTime;

    @ApiModelProperty("0 正常 | -1 冻结")
    private Integer status;

    @ApiModelProperty(value = "创建人", hidden = true)
    private Long createId;

    @ApiModelProperty("创建时间")
    private LocalDateTime createTime;

    @TableField(exist = false)
    @ApiModelProperty(value = "用户角色id")
    private Collection<Long> roleIds;

}
